wxapp.ReceiveMsg = {
    _TAG: "wxfish.ReceiveMsg",
    boot: function() {
        this.cmdMap = {};
    },
    shut: function() {
        this.cmdMap = {}, ty.NotificationCenter.ignoreScope(this);
    },
    onTCP_Open: function() {
        hall.MsgFactory.bindUser();
    },
    onReceiveTCP_Msg: function(e) {
        var t = e.cmd, a = e.result;
        if (a) {
            if (a.gameId === ty.SystemInfo.hallId) {
                var o = this.cmdMap[t];
                o ? o.call(this, e) : hall.LOGD(this._TAG, "未注册关于消息 ： " + t + " 的监听！");
            }
        } else if (t == ty.EventType.MSG_LOG_OUT) {
            var n = e.error ? e.error.info : null;
            n && hall.MsgBoxManager.showToast({
                title: n
            });
        }
    },
    _onLocInfo: function(e) {
        ddz.matchModel.cleanWaitInfo();
        var t, a = parseInt(e[0]), o = parseInt(e[1]), n = parseInt(e[2]), i = parseInt(e[3]), l = wx.getLaunchOptionsSync();
        hall.LOGE(null, "+++++++++sceneInfo++++++++" + JSON.stringify(l));
        l.scene;
        var r = l.query;
        t = l.shareTicket;
        hall.GlobalFuncs.replaceToStringWithDic(r);
        if (r && r.sourceCode) {
            if (r.inviteCode && ddz.gameModel.bindInviteCode(parseInt(r.inviteCode)), r.sourceCode == ddz.Share.clickStatShareType.clickStatShareTypeInviteFriend) r.ftID && r.ftID;
            r.ftID && "" == ty.SystemInfo.ftID && !ddz.Share.isOnShare ? (ty.SystemInfo.ftID = r.ftID, 
            ddz.Share.shareKeywordReplace.inviteFriendID = r.ftID) : t && "" == ty.SystemInfo.shareTicket && !ddz.Share.isOnShare && r.sourceCode == ddz.Share.clickStatShareType.clickStatShareTypeRankList && (ty.SystemInfo.shareTicket = t);
            var s = hall.GlobalTimer.getCurDay();
            if (s != hall.GlobalFuncs.ReadStringFromLocalStorage(ddz.Share.LAST_LOGIN_TIME, "") && r.inviteName && r.sourceCode != ddz.Share.clickStatShareType.clickStatShareTypeInviteFriend) {
                hall.GlobalFuncs.setInLocalStorage(ddz.Share.LAST_LOGIN_TIME, s);
                var d = "<color=#1A6951>成功帮助 " + r.inviteName + " 获得</color><img src='dda_button_diamond_black' height=34 width=42/><color=#1A6951> +1<c/><br/><color=#1A6951>每期仅能帮助一位好友哦</c>";
                ddz.GlobalFuncs.showTipsWindowWithString(d, null, "确定");
            }
        }
        if (hall.GlobalFuncs.setInLocalStorage(ddz.Share.LAST_LOGIN_TIME, hall.GlobalTimer.getCurDay()), 
        ddz.Share.playAnimationAfterShareWithType(), ddz.MsgFactory.getMatchRecords(), ddz.Share.isOnShare = !1, 
        "" != ty.SystemInfo.ftID && (ddz.friendModel.enterFriendTable(ty.SystemInfo.ftID), 
        ty.SystemInfo.shareTicket = ""), ddz.waitGetRevial && "showWindow" == ddz.waitGetRevial.type && (ddz.LOGD("ddz.waitGetRevial.type", "分享到了个人!" + ddz.waitGetRevial.type), 
        ddz.GlobalFuncs.showRevialWindow(!0), ddz.waitGetRevial = null), ddz.waitGetRevial && "send" == ddz.waitGetRevial.type) {
            var c = ddz.waitGetRevial.needCount;
            ddz.waitGetRevial = {
                type: "waitRecive",
                curCount: 0,
                needCount: c
            };
            for (var h = 0; h < c; h++) ddz.gameModel.shareToGetreward(ddz.Share.SharePointType.firstFail);
        }
        hall.LOGE(null, "+++++++++shareTicket++++++++" + ty.SystemInfo.shareTicket), 0 != o && 0 != n ? (hall.MsgFactory.getQuickStart(ty.UserInfo.userId, a, o, hall.staticSystemInfo.version, null, null, null, n), 
        i > 5 && "" != ty.SystemInfo.shareTicket && (t = ty.SystemInfo.shareTicket, hall.GlobalFuncs.isInAtScene("TableScene") && ty.NotificationCenter.trigger(ddz.EventType.REMOVE_TABLE_ANI), 
        hall.GlobalFuncs.gotoRank(t)), ty.SystemInfo.shareTicket = "") : (ty.NotificationCenter.trigger(ddz.EventType.REMOVE_TABLE_ANI), 
        "" != ty.SystemInfo.shareTicket ? (t = ty.SystemInfo.shareTicket, hall.GlobalFuncs.gotoRank(t)) : (hall.LOGE(null, "file = [HallNetWorkCenter] fun = [_onLocInfo] 1111"), 
        ddz.matchResultPanel || (hall.LOGE(null, "file = [HallNetWorkCenter] fun = [_onLocInfo] 2222"), 
        hall.GlobalFuncs.gotoDdz())), ty.SystemInfo.shareTicket = "");
    },
    onReceiveUserInfo: function(e) {
        ty.BiLog.clickStat(ty.UserInfo.clickStatEventType.clickStatEventTypeTCP_Success, [ JSON.stringify(e) ]), 
        this.onUserInfo(e), hall.MsgFactory.bindGame(ty.SystemInfo.gameId), ddz.matchModel.matchUpdate(), 
        ddz.matchModel.getMatchDes(), ddz.gameModel.queryInviteConfig(), ddz.gameModel.getCommonConfig(), 
        ddz.gameModel.getShareCommonConfig(), ddz.gameModel.getMatchingMassageConfig(), 
        hall.MsgFactory.getBagInfo(), hall.MsgFactory.getTimeStamp();
    },
    onReceiveBagInfo: function(e) {
        void 0 !== e && hall.ME.parseBagInfo(e);
    },
    onReceiveGameData: function(e) {
        this.onGameData(e), hall.MsgFactory.getHallInfo(ty.SystemInfo.gameId);
    },
    onTodoTask: function(e) {
        hall.LOGD(this._TAG, "onTodoTask -------------------------"), e && e.result && hall.gameWorld.model.m_todoTask.parseTodoTask(e.result);
    },
    onUpdateChangedData: function(e) {
        if (hall.LOGD(this._TAG, "onUpdateGold -------------------------"), void 0 !== e) {
            var t = e.result;
            if (void 0 !== t && void 0 !== t.changes) {
                var a = t.gameId;
                hall.LOGD(this._TAG, "gameid = " + a);
                for (var o = 0; o < t.changes.length; o++) {
                    var n = t.changes[o];
                    void 0 !== n && ("gdata" == n ? (hall.LOGD(this._TAG, "update_notify,更新gdata"), 
                    hall.MsgFactory.getGameData(a)) : "item" == n ? (hall.LOGD(this._TAG, "update_notify,更新道具"), 
                    hall.MsgFactory.getBagInfo()) : "udata" == n && (hall.LOGD(this._TAG, "update_notify,更新钻石金币"), 
                    hall.MsgFactory.getUserInfo(a)));
                }
            }
        }
    },
    onUserName: function(e) {
        var t = e.result;
        if (void 0 !== t) {
            var a = t.action;
            if ("get_name" == a) {
                var o = t.code;
                0 != o && o ? hall.MsgBoxManager.showToast({
                    title: "你输入的ID不正确，请输入有效ID."
                }) : ty.NotificationCenter.trigger(ddz.EventType.MSG_NAME_BACK, t);
            } else a == ddz.EventType.ACTION_SYNC_TIMESTAMP && ty.NotificationCenter.trigger(ddz.EventType.GET_TIMESTAMP, t);
        }
    },
    onProdDelivery: function(e) {
        hall.LOGD(this._TAG, "onProdDelivery -------------------- "), ty.NotificationCenter.trigger(ddz.EventType.UPDATE_PAY_SUCCESS, e);
    },
    onLoginReward: function(e) {
        var t = e[0].result;
        void 0 !== t && t.success && (hall.ME.loginRewardinfo.parse(t), ty.NotificationCenter.trigger(ddz.EventType.MSG_REWARD_SUCCESS));
    },
    onUserInfo: function(e) {
        void 0 !== e && (this._bBindGame, ty.UserInfo.userId = e.result.userId, ddz.LOGD(null, "onUserInfo argument = " + JSON.stringify(e)), 
        hall.ME.parseUserInfo(e), ty.NotificationCenter.trigger(ty.EventType.UPDATE_UER_INFO, hall.ME));
    },
    onGameData: function(e) {
        if (hall.LOGD(this._TAG, "onGameData"), void 0 !== e) {
            if (hall.ME.parseGameData(e), hall.ME.hallGData.m_winchipstats && hall.ME.hallGData.m_winchipstats.length > 0 && ty.NotificationCenter.trigger(ddz.EventType.MSG_GDATA_BACK), 
            !hall.GlobalFuncs.checkMsgWithGameId(e, ddz.GameId)) return;
            this._bBindGame && (this._bBindGame = !1, 1 == hall.ME.gdataInfo.m_loginsum && hall.MsgFactory.getUserInfo(ddz.GameId), 
            hall.MsgFactory.getEveryTaskInfo(ddz.GameId, "update"), hall.MsgFactory.getPersonalMsg(), 
            hall.MsgFactory.getGlobalMsg());
        }
    },
    onLed: function(e) {
        var t = e[0].result.text;
        t && (hall.gameWorld.parseLed(t), hall.gameWorld.model.m_ledBeWork || ty.NotificationCenter.trigger(hall.EventType.CMD_LED_RECEIVE, t));
    },
    _onTodoQuickStart: function(e) {
        hall.MsgFactory.getQuickStart(ty.UserInfo.userId, e.gameid, e.roomid, hall.staticSystemInfo.version, null, null, null);
    },
    onUPDATE_UER_INFO: function(e) {
        e.objectInfo.m_heart.heartbeat;
    },
    onLogout: function(e) {
        hall.ME.isOtherLogin = !0;
        var t = e.error;
        t && hall.MsgBoxManager.showToast({
            title: t.info
        });
    },
    onRoomAction: function(e) {
        hall.LOGD(null, this._TAG, "onRoomAction -------------------- ");
    },
    onCash: function(e) {
        ty.NotificationCenter.trigger(ddz.EventType.UPDATE_CASH_RESULT, e);
    },
    onModuleTip: function(e) {
        var t = e.result;
        void 0 !== t && "update" == t.action && hall.ME.msgInfo.praseModultTip(t.modules);
    },
    onRankList: function(e) {
        ty.NotificationCenter.trigger(ddz.EventType.MSG_CUSTOM_RANK, e);
    },
    onMessage: function(e) {
        var t = e.result;
        if (void 0 !== t) {
            var a = t.action, o = t.list;
            if ("sys_msg_list" == a) hall.ME.msgInfo.parseSysInfo(o), ty.NotificationCenter.trigger(ddz.EventType.MSG_SYS_MESSAGE_BACK); else if ("msg_receive_list" == a) hall.ME.msgInfo.parseReceiveInfo(o), 
            ty.NotificationCenter.trigger(ddz.EventType.MSG_REC_MESSAGE_BACK); else if ("msg_send_list" == a) hall.ME.msgInfo.parseSendInfo(o), 
            ty.NotificationCenter.trigger(ddz.EventType.MSG_SEND_MESSAGE_BACK); else if ("msg_send" == a) {
                var n = 0 == t.code ? "发送成功" : "发送失败";
                hall.MsgBoxManager.showToast({
                    title: n
                });
            } else if ("unread_count" == a) {
                var i = t.chat_unread;
                t.sys_unread;
                i ? hall.GlobalFuncs.setInLocalStorage(hall.HAS_MAIL_KEY, !0) : hall.GlobalFuncs.setInLocalStorage(hall.HAS_MAIL_KEY, !1);
            } else "list" == a && ty.NotificationCenter.trigger(ddz.EventType.RECIVE_MESSAGE_LIST, t);
        }
    },
    onComplain: function(e) {
        var t, a = e, o = a.error;
        t = o ? o.info : a.result.success.info, hall.MsgBoxManager.showToast({
            title: t
        });
    },
    onStoreInfo: function(e) {
        hall.LOGD(null, "onStoreInfo receivemsg--------"), hall.LOGD(this._TAG, "onStoreInfo receivemsg-------------------------"), 
        hall.LOGD(this._TAG, "the receivemsg is:" + JSON.stringify(e)), void 0 !== e && void 0 !== e.result && (hall.gameWorld.parseMatchStore(e.result), 
        ty.NotificationCenter.trigger(ddz.EventType.STORE_INFO_UPDATE));
    },
    onClassicPopwnd: function(e) {
        hall.LOGD(this._TAG, "onClassicPopwnd receivemsg-------------------------"), ty.NotificationCenter.trigger(ddz.EventType.UPDATE_POP_WINDOW, e);
    },
    onTableLeave: function(e) {},
    onStore: function(e) {
        var t = e[0].result;
        if (void 0 !== t) {
            var a = t.action, o = t.code;
            if ("jewel_give" == a) if (0 == o) ; else t.info;
        }
    },
    onCustomTable: function(e) {
        var t = e.result;
        if (t) {
            var a = t.action;
            "game_data" == a ? ty.NotificationCenter.trigger(ddz.EventType.MSG_CUSTOMTABLE_GAMEDATA, t) : "fight_data" == a && ty.NotificationCenter.trigger(ddz.EventType.MSG_CUSTOMTABLE_FIGHTDATA, t);
        }
    },
    onRoomOnlineInfo: function(e) {}
}, wxapp.ReceiveMsg.boot();